#include "convertFromRgbToHsv3.h"

bool compareResult(int* new_hsv, unsigned int start_point) {
	for (int i=start_point; i<GOLDEN_ARR_SIZE; i+=3) {
		if (new_hsv[i] != GOLDEN_ARR[i]) return false;
	}
	return true;
}

Result compareResultOfHsv(int* new_hsv, CompareParams* compare_to, unsigned int size) {
	for (int i=0; i < size; ++i) {
		if (!compareResult(new_hsv, compare_to[i])) {
			return FAIL;
		}
	}
	return SUCCESS;
}

Result test3() {
	IplImage* img = cvLoadImage("C:\\Documents and Settings\\snirbo\\Desktop\\convertFromRgbToHsv\\schiffer.bmp");
	int* new_data = ConvertFromRgbToHsv(img);
	if (new_data == 0) {
		return printTestResult(3, FAIL);
	} else {
		CompareParams comp[1] = {V};
		return printTestResult(3, compareResultOfHsv(new_data, comp, 1));
	}
}

#ifdef __TEST3__
int main(int argc, char **argv) {
	if (!test1() || !test2() || !test3()) {
		cout << "TOTAL TEST FAILED!\n";
		getchar();
		exit(1);
	}
	cout << "TOTAL TEST SUCCEEDED\n";
	getchar();
	return 0;
}
#endif